#ifndef TRANSACTION_OBJECT_CONTAINER_H
#define TRANSACTION_OBJECT_CONTAINER_H

#include <boost/unordered_map.hpp>

#include "common.h"
#include "transaction_object.h"

class transaction_object_container
{
public:
	transaction_object_container();

	bool insert(void* ptr, transaction_object_t* obj);

	bool erase(void* ptr);

	transaction_object_t* find(void *ptr);

private:
	boost::unordered_map<void*, transaction_object_t*> container_;
	boost::shared_mutex mutex_;
};

#endif // TRANSACTION_OBJECT_CONTAINER_H
